<template>
  <div class="head-box">
    <div class="left-box">
      <span class="title">{{title}}</span>
      <span class="type">{{type}}</span>
    </div>
    <div class="right-box" @click="handleRefresh">
      <span class="change">换一批</span>
      <van-icon name="replay" :size="iconFontSize" color="#061B41" />
    </div>
  </div>
</template>

<script>
import Taro from "@tarojs/taro";
export default {
  name: "Platehead",
  props: {
    title: String,
    type: String
  },
  computed: {
    iconFontSize: function() {
      return Taro.pxTransform(18, 750);
    }
  },
  data() {
    return {
      currentPage:1
    };
  },
  methods:{
    handleRefresh(){
      this.currentPage++
      let data = {'currentPage': this.currentPage,'title':this.title}
      this.$emit('refresh', data)
    }
  }
};
</script>

<style scoped>
.head-box {
  display: flex;
  justify-content: space-between;
  margin-bottom: 48px;
  margin-top:48px;
  align-items: flex-end;
}

.left-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.title {
  font-size: 32px;
  font-family: Alibaba PuHuiTi;
  font-weight: bold;
  color: rgba(6, 27, 65, 0.75);
  line-height: 32px;
  margin-bottom: 10px;
}

.type {
  font-size: 20px;
  font-family: Alibaba PuHuiTi;
  font-weight: 400;
  color: rgba(6, 27, 65, 0.75);
  line-height: 20px;
}

.right-box {
  display: flex;
  align-items: center;
}

.change {
  font-size: 20px;
  font-family: Alibaba PuHuiTi;
  font-weight: 700;
  color: rgba(6, 27, 65, 0.75);
  line-height: 20px;
  margin-right: 8px;
}
</style>